import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const locationMap = resolve => {
    require.ensure(['@/Pages/staff/locationMap.vue'], () => {
        resolve(require('@/Pages/staff/locationMap.vue'))
    })
}
const punchCard = resolve => {
    require.ensure(['@/Pages/staff/punchCard.vue'], () => {
        resolve(require('@/Pages/staff/punchCard.vue'))
    })
}
const punchCardStatistics = resolve => {
    require.ensure(['@/Pages/staff/punchCardStatistics.vue'], () => {
        resolve(require('@/Pages/staff/punchCardStatistics.vue'))
    })
}
const installationPlan = resolve => {
    require.ensure(['@/Pages/staff/installationPlan.vue'], () => {
        resolve(require('@/Pages/staff/installationPlan.vue'))
    })
}
const recordetail = resolve => {
    require.ensure(['@/Pages/common/recordetail.vue'], () => {
        resolve(require('@/Pages/common/recordetail.vue'))
    })
}
const recorddetailD = resolve => {
    require.ensure(['@/Pages/common/recorddetailD.vue'], () => {
        resolve(require('@/Pages/common/recorddetailD.vue'))
    })
}
const installationPlanLIst = resolve => {
    require.ensure(['@/Pages/staff/installationPlanLIst.vue'], () => {
        resolve(require('@/Pages/staff/installationPlanLIst.vue'))
    })
}
const examineCondition = resolve => {
    require.ensure(['@/Pages/Administrator/examineCondition.vue'], () => {
        resolve(require('@/Pages/Administrator/examineCondition.vue'))
    })
}

let routes = [
    {
        path: '/',
        redirect: '/punchCard'
    },
    {
        path: '/locationMap',
        name: 'locationMap',
        component: locationMap
    },
    {
        path: '/punchCard',
        name: 'punchCard',
        component: punchCard
    },
    {
        path: '/recordetail',
        name: 'recordetail',
        component: recordetail
    },
    {
        path: '/recorddetailD',
        name: 'recorddetailD',
        component: recorddetailD
    },
    {
        path: '/punchCardStatistics',
        name: 'punchCardStatistics',
        component: punchCardStatistics
    },
    {
        path: '/examineCondition',
        name: 'examineCondition',
        component: examineCondition
    },
    {
        path: '/installationPlan',
        name: 'installationPlan',
        component: installationPlan
    },
    {
        path: '/installationPlanLIst',
        name: 'installationPlanLIst',
        component: installationPlanLIst
    }
]

export default new Router({
    routes
})

